package com.share.homestay.controller;


import com.share.homestay.entity.OrderLogs;
import com.share.homestay.entity.SysUser;
import com.share.homestay.entity.TjPermissions;
import com.share.homestay.interfaces.SysUserServiceApi;
import com.share.homestay.pojo.JsonResult;
import com.share.homestay.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class SysUserController implements SysUserServiceApi {

    @Autowired
    private SysUserService sysUserService;
    @Override
    public JsonResult sysUserPageQuery(SysUser sysUser, Integer pageNum, Integer pageSize) {
        return sysUserService.sysUserPageQuery(sysUser,pageNum,pageSize);
    }

    @Override
    public SysUser getUserByUsername(String username) {
        return sysUserService.getUserByUsername(username);
    }

    @Override
    public List<TjPermissions> selectPermsByUserId(Long userId) {
        return sysUserService.selectPermsByUserId(userId);
    }

    @Override
    public void addOrderLogs(OrderLogs orderLogs) {
        sysUserService.addOrderLogs(orderLogs);
    }

    @Override
    public JsonResult selectLogs(OrderLogs orderLogs, Integer pageNum, Integer pageSize) {
        return sysUserService.selectLogs(orderLogs,pageNum,pageSize);
    }

    @Override
    public List<SysUser> findAllUser() {
        return sysUserService.findAllUser();
    }

}
